﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="wfLandAnalysis.aspx.cs" Inherits="WSBulTasDesa.wfLandAnalysis" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"
        EnableScriptGlobalization="true" EnableScriptLocalization="true">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnCalculate" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
        </Triggers>
        <ContentTemplate>
            <table style="width: 100%;">
                <tr>
                    <td valign="top" colspan="2">
                        Suelo
                        <asp:GridView ID="grvLandCategory" ShowHeader="false" AutoGenerateColumns="False"
                            runat="server">
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <h2>
                                            <asp:Label ID="lblLandCategoryName" runat="server" Text='<%# Eval("Name") %>' />
                                        </h2>
                                        <asp:GridView ID="grvLandClasification" ShowFooter="true" AutoGenerateColumns="false"
                                            CellSpacing="0" DataSource='<%# Eval("LandClasification") %>' runat="server"
                                            BorderStyle="Solid" BorderWidth="1px" CellPadding="0" DataKeyNames="Id">
                                            <Columns>
                                                <asp:TemplateField HeaderText="Calidad">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblId" runat="server" Text='<%# Eval("Id") %>' />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        Subtotal</FooterTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Superficie" FooterStyle-HorizontalAlign="Right">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtHa" runat="server" Text='<%# Eval("Land.HaString") %>' BackColor='<%# System.Drawing.Color.FromName(Eval("Color").ToString()) %>'
                                                            SkinID="txtGridView"></asp:TextBox>
                                                        <ajaxToolkit:FilteredTextBoxExtender ID="ftbHa" runat="server" TargetControlID="txtHa"
                                                            FilterType="Custom, Numbers" ValidChars="." />
                                                        <asp:RegularExpressionValidator ID="revHa" runat="server" ControlToValidate="txtHa"
                                                            ErrorMessage="Número decimal fuera del rango establecido" Display="None" ValidationExpression="^[0-9]{1,6}(\.[0-9]{0,4})?$"></asp:RegularExpressionValidator>
                                                        <asp:RequiredFieldValidator ID="rfvHa" runat="server" ControlToValidate="txtHa" ErrorMessage="Ingrese Has."
                                                            Display="None"></asp:RequiredFieldValidator>
                                                        <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceHa" TargetControlID="rfvHa"
                                                            Width="200px" />
                                                        <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceHaBis" TargetControlID="revHa"
                                                            Width="200px" />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:Label ID="lblSubTotalHa" runat="server" />
                                                    </FooterTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="U$S/Ha">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtPriceHa" runat="server" Text='<%# Eval("Land.PriceHa") %>' BackColor='<%# System.Drawing.Color.FromName(Eval("Color").ToString()) %>'
                                                            SkinID="txtGridView"></asp:TextBox>
                                                        <ajaxToolkit:FilteredTextBoxExtender ID="ftbPriceHa" runat="server" TargetControlID="txtPriceHa"
                                                            FilterType="Custom, Numbers" />
                                                        <asp:RequiredFieldValidator ID="rfvPriceHa" runat="server" ControlToValidate="txtPriceHa"
                                                            ErrorMessage="Ingrese U$S/Ha." Display="None"></asp:RequiredFieldValidator>
                                                        <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vcePriceHa" TargetControlID="rfvPriceHa"
                                                            Width="200px" />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:Label ID="lblSubTotalPriceHa" runat="server" />
                                                    </FooterTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Porcentaje">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtPercent" ReadOnly="true" TabIndex="-1" runat="server" BackColor='<%# System.Drawing.Color.FromName(Eval("Color").ToString()) %>'
                                                            SkinID="txtGridView"></asp:TextBox>
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:Label ID="lblSubTotalPercent" runat="server" />
                                                    </FooterTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="U$S Total" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right"
                                                    ItemStyle-Width="80px">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblSubTotalItem" runat="server" />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:Label ID="lblTotalItem" runat="server" />
                                                    </FooterTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                    <td valign="top">
                        Campo
                        <div id="Camp" style="overflow: auto; height: 200px">
                            <asp:GridView ID="grvBetCamp" AutoGenerateColumns="false" ShowFooter="true" CellSpacing="0"
                                runat="server" BorderStyle="Solid" BorderWidth="1px" CellPadding="0" ShowHeaderWhenEmpty="True"
                                DataKeyNames="Id" OnRowCancelingEdit="grvBetCamp_RowCancelingEdit" OnRowEditing="grvBetCamp_RowEditing"
                                OnRowUpdating="grvBetCamp_RowUpdating" OnRowDeleting="grvBetCamp_RowDeleting">
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            Mejora
                                            <br />
                                            <asp:TextBox ID="txtName" runat="server" Text=""></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName"
                                                Display="None" ErrorMessage="Ingrese nombre." ValidationGroup="Add"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceName" TargetControlID="rfvName"
                                                Width="150px" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblId" runat="server" Text='<%# Bind("Name") %>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName"
                                                Display="None" ErrorMessage="Ingrese nombre." ValidationGroup="Edit"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceName" TargetControlID="rfvName"
                                                Width="150px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            U/M<br />
                                            <asp:DropDownList ID="ddlMeasureUnit" runat="server">
                                                <asp:ListItem Text="<>" Value=""></asp:ListItem>
                                                <asp:ListItem>un</asp:ListItem>
                                                <asp:ListItem>m2</asp:ListItem>
                                                <asp:ListItem>kv</asp:ListItem>
                                                <asp:ListItem>tn</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvMeasureUnit" runat="server" ControlToValidate="ddlMeasureUnit"
                                                Display="None" ErrorMessage="Ingrese U/M." ValidationGroup="Add"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceMeasureUnit" TargetControlID="rfvMeasureUnit"
                                                Width="150px" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblMeasureUnite" runat="server" Text='<%# Bind("MeasureUnit") %>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlMeasureUnit" runat="server" SelectedValue='<%# Eval("MeasureUnit") %>'>
                                                <asp:ListItem Text="<>" Value=""></asp:ListItem>
                                                <asp:ListItem>un</asp:ListItem>
                                                <asp:ListItem>m2</asp:ListItem>
                                                <asp:ListItem>kv</asp:ListItem>
                                                <asp:ListItem>tn</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvMeasureUnit" runat="server" ControlToValidate="ddlMeasureUnit"
                                                Display="None" ErrorMessage="Ingrese U/M." ValidationGroup="Edit"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceMeasureUnit" TargetControlID="rfvMeasureUnit"
                                                Width="150px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Right">
                                        <HeaderTemplate>
                                            Cant<br />
                                            <asp:TextBox ID="txtQuantity" runat="server" Text="" MaxLength="6" SkinID="txtGridView"></asp:TextBox>
                                            <ajaxToolkit:FilteredTextBoxExtender ID="ftbQuantity" runat="server" TargetControlID="txtQuantity"
                                                FilterType="Custom, Numbers" ValidChars="." />
                                            <asp:RequiredFieldValidator ID="rfvQuantity" runat="server" ControlToValidate="txtQuantity"
                                                ErrorMessage="Ingrese cantidad." Display="None" ValidationGroup="Add"></asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator ID="revQuantity" runat="server" ControlToValidate="txtQuantity"
                                                ValidationGroup="Add" ErrorMessage="Número decimal fuera del rango establecido"
                                                Display="None" ValidationExpression="^[0-9]{1,6}(\.[0-9]{0,2})?$"></asp:RegularExpressionValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceQuantity" TargetControlID="rfvQuantity"
                                                Width="150px" />
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceQuantityBis" TargetControlID="revQuantity"
                                                Width="150px" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblQuantity" runat="server" Text='<%# Bind("Quantity") %>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%#Bind("QuantityString") %>'
                                                MaxLength="6" SkinID="txtGridView"></asp:TextBox>
                                            <ajaxToolkit:FilteredTextBoxExtender ID="ftbQuantity" runat="server" TargetControlID="txtQuantity"
                                                FilterType="Custom, Numbers" ValidChars="." />
                                            <asp:RequiredFieldValidator ID="rfvQuantity" runat="server" ControlToValidate="txtQuantity"
                                                ErrorMessage="Ingrese cantidad." Display="None" ValidationGroup="Add"></asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator ID="revQuantity" runat="server" ControlToValidate="txtQuantity"
                                                ValidationGroup="Add" ErrorMessage="Número decimal fuera del rango establecido"
                                                Display="None" ValidationExpression="^[0-9]{1,6}(\.[0-9]{0,2})?$"></asp:RegularExpressionValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceQuantity" TargetControlID="rfvQuantity"
                                                Width="150px" />
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceQuantityBis" TargetControlID="revQuantity"
                                                Width="150px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Right">
                                        <HeaderTemplate>
                                            U$S/cant<br />
                                            <asp:TextBox ID="txtValue" runat="server" Text="" SkinID="txtGridView"></asp:TextBox>
                                            <ajaxToolkit:FilteredTextBoxExtender ID="ftbValue" runat="server" TargetControlID="txtValue"
                                                FilterType="Custom, Numbers" />
                                            <asp:RequiredFieldValidator ID="rfvValue" runat="server" ControlToValidate="txtValue"
                                                ErrorMessage="Ingrese valor unitario." Display="None" ValidationGroup="Add"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceValue" TargetControlID="rfvValue"
                                                Width="150px" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblValue" runat="server" Text='<%# Bind("Value") %>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtValue" runat="server" Text='<%# Bind("Value") %>' SkinID="txtGridView"></asp:TextBox>
                                            <ajaxToolkit:FilteredTextBoxExtender ID="ftbValue" runat="server" TargetControlID="txtValue"
                                                FilterType="Custom, Numbers" />
                                            <asp:RequiredFieldValidator ID="rfvValue" runat="server" ControlToValidate="txtValue"
                                                ErrorMessage="Ingrese valor unitario." Display="None" ValidationGroup="Edit"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceValue" TargetControlID="rfvValue"
                                                Width="150px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
                                        <HeaderTemplate>
                                            <asp:Button ID="btnAdd" runat="server" Text="Agregar" OnClick="btnAdd_Click" ValidationGroup="Add" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblTotalItem" runat="server" Text='<%# Bind("Total") %>' />
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:Label ID="lblTotal" runat="server" Text='<%# GetTotalBet("C") %>' />
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle Width="40px" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imbtnEdit" runat="server" ImageUrl="~/Img/edit.PNG" CommandName="Edit"
                                                CausesValidation="False" />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:ImageButton ID="ibtnUpdate" runat="server" CommandName="Update" ImageUrl="~/Img/confirmEdit.PNG"
                                                ValidationGroup="Edit"></asp:ImageButton>
                                            <asp:ImageButton ID="ibtnCancel" runat="server" CommandName="Cancel" ImageUrl="~/Img/cancelEdit.PNG"
                                                CausesValidation="false"></asp:ImageButton>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <ItemStyle Width="20px" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imbtnDelete" runat="server" ImageUrl="~/Img/delete.PNG" CommandName="Delete"
                                                CausesValidation="False" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                        Casco
                        <div id="Div1" style="overflow: auto; height: 200px">
                            <asp:GridView ID="grvBetBody" AutoGenerateColumns="false" ShowFooter="true" CellSpacing="0"
                                runat="server" BorderStyle="Solid" BorderWidth="1px" CellPadding="0" ShowHeaderWhenEmpty="True"
                                DataKeyNames="Id" OnRowCancelingEdit="grvBetBody_RowCancelingEdit" OnRowEditing="grvBetBody_RowEditing"
                                OnRowUpdating="grvBetBody_RowUpdating" OnRowDeleting="grvBetBody_RowDeleting">
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            Mejora
                                            <br />
                                            <asp:TextBox ID="txtName" runat="server" Text=""></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName"
                                                Display="None" ErrorMessage="Ingrese nombre." ValidationGroup="AddBody"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceName" TargetControlID="rfvName"
                                                Width="150px" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblId" runat="server" Text='<%# Bind("Name") %>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName"
                                                Display="None" ErrorMessage="Ingrese nombre." ValidationGroup="Edit"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceName" TargetControlID="rfvName"
                                                Width="150px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            U/M<br />
                                            <asp:DropDownList ID="ddlMeasureUnit" runat="server">
                                                <asp:ListItem Text="<>" Value=""></asp:ListItem>
                                                <asp:ListItem>un</asp:ListItem>
                                                <asp:ListItem>m2</asp:ListItem>
                                                <asp:ListItem>kv</asp:ListItem>
                                                <asp:ListItem>tn</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvMeasureUnit" runat="server" ControlToValidate="ddlMeasureUnit"
                                                Display="None" ErrorMessage="Ingrese U/M." ValidationGroup="AddBody"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceMeasureUnit" TargetControlID="rfvMeasureUnit"
                                                Width="150px" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblMeasureUnite" runat="server" Text='<%# Bind("MeasureUnit") %>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlMeasureUnit" runat="server" SelectedValue='<%# Eval("MeasureUnit") %>'>
                                                <asp:ListItem Text="<>" Value=""></asp:ListItem>
                                                <asp:ListItem>un</asp:ListItem>
                                                <asp:ListItem>m2</asp:ListItem>
                                                <asp:ListItem>kv</asp:ListItem>
                                                <asp:ListItem>tn</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvMeasureUnit" runat="server" ControlToValidate="ddlMeasureUnit"
                                                Display="None" ErrorMessage="Ingrese U/M." ValidationGroup="Edit"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceMeasureUnit" TargetControlID="rfvMeasureUnit"
                                                Width="150px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Right">
                                        <HeaderTemplate>
                                            Cant<br />
                                            <asp:TextBox ID="txtQuantity" runat="server" Text="" MaxLength="6" SkinID="txtGridView"></asp:TextBox>
                                            <ajaxToolkit:FilteredTextBoxExtender ID="ftbQuantity" runat="server" TargetControlID="txtQuantity"
                                                FilterType="Custom, Numbers" ValidChars="." />
                                            <asp:RequiredFieldValidator ID="rfvQuantity" runat="server" ControlToValidate="txtQuantity"
                                                ErrorMessage="Ingrese cantidad." Display="None" ValidationGroup="AddBody"></asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator ID="revQuantity" runat="server" ControlToValidate="txtQuantity"
                                                ValidationGroup="Add" ErrorMessage="Número decimal fuera del rango establecido"
                                                Display="None" ValidationExpression="^[0-9]{1,6}(\.[0-9]{0,2})?$"></asp:RegularExpressionValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceQuantity" TargetControlID="rfvQuantity"
                                                Width="150px" />
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceQuantityBis" TargetControlID="revQuantity"
                                                Width="150px" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblQuantity" runat="server" Text='<%# Bind("Quantity") %>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%#Bind("QuantityString") %>'
                                                MaxLength="6" SkinID="txtGridView"></asp:TextBox>
                                            <ajaxToolkit:FilteredTextBoxExtender ID="ftbQuantity" runat="server" TargetControlID="txtQuantity"
                                                FilterType="Custom, Numbers" ValidChars="." />
                                            <asp:RequiredFieldValidator ID="rfvQuantity" runat="server" ControlToValidate="txtQuantity"
                                                ErrorMessage="Ingrese cantidad." Display="None" ValidationGroup="AddBody"></asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator ID="revQuantity" runat="server" ControlToValidate="txtQuantity"
                                                ValidationGroup="Add" ErrorMessage="Número decimal fuera del rango establecido"
                                                Display="None" ValidationExpression="^[0-9]{1,6}(\.[0-9]{0,2})?$"></asp:RegularExpressionValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceQuantity" TargetControlID="rfvQuantity"
                                                Width="150px" />
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceQuantityBis" TargetControlID="revQuantity"
                                                Width="150px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Right">
                                        <HeaderTemplate>
                                            U$S/cant<br />
                                            <asp:TextBox ID="txtValue" runat="server" Text="" SkinID="txtGridView"></asp:TextBox>
                                            <ajaxToolkit:FilteredTextBoxExtender ID="ftbValue" runat="server" TargetControlID="txtValue"
                                                FilterType="Custom, Numbers" />
                                            <asp:RequiredFieldValidator ID="rfvValue" runat="server" ControlToValidate="txtValue"
                                                ErrorMessage="Ingrese valor unitario." Display="None" ValidationGroup="AddBody"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceValue" TargetControlID="rfvValue"
                                                Width="150px" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblValue" runat="server" Text='<%# Bind("Value") %>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtValue" runat="server" Text='<%# Bind("Value") %>' SkinID="txtGridView"></asp:TextBox>
                                            <ajaxToolkit:FilteredTextBoxExtender ID="ftbValue" runat="server" TargetControlID="txtValue"
                                                FilterType="Custom, Numbers" />
                                            <asp:RequiredFieldValidator ID="rfvValue" runat="server" ControlToValidate="txtValue"
                                                ErrorMessage="Ingrese valor unitario." Display="None" ValidationGroup="Edit"></asp:RequiredFieldValidator>
                                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceValue" TargetControlID="rfvValue"
                                                Width="150px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
                                        <HeaderTemplate>
                                            <asp:Button ID="btnAdd" runat="server" Text="Agregar" OnClick="btnAddBody_Click"
                                                ValidationGroup="AddBody" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblTotalItem" runat="server" Text='<%# Bind("Total") %>' />
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:Label ID="lblTotal" runat="server" Text='<%# GetTotalBet("B") %>' />
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle Width="40px" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imbtnEdit" runat="server" ImageUrl="~/Img/edit.PNG" CommandName="Edit"
                                                CausesValidation="False" />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:ImageButton ID="ibtnUpdate" runat="server" CommandName="Update" ImageUrl="~/Img/confirmEdit.PNG"
                                                ValidationGroup="Edit"></asp:ImageButton>
                                            <asp:ImageButton ID="ibtnCancel" runat="server" CommandName="Cancel" ImageUrl="~/Img/cancelEdit.PNG"
                                                CausesValidation="false"></asp:ImageButton>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <ItemStyle Width="20px" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imbtnDelete" runat="server" ImageUrl="~/Img/delete.PNG" CommandName="Delete"
                                                CausesValidation="False" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                        <br />
                        <br />
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Subtotal
                    </td>
                    <td valign="top" align="right">
                        <asp:Label ID="lblTotalLand" runat="server" SkinID="Bold"></asp:Label>
                    </td>
                    <td valign="top" align="right">
                        <asp:Label ID="lblTotalBetterment" runat="server" SkinID="Bold"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Prom/Ha
                    </td>
                    <td valign="top" align="right">
                        <asp:Label ID="lblAverageLand" runat="server" SkinID="Bold"></asp:Label>
                    </td>
                    <td valign="top" align="right">
                        <asp:Label ID="lblAverageBetterment" runat="server" SkinID="Bold"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Total
                    </td>
                    <td valign="top">
                        &nbsp;
                    </td>
                    <td valign="top" align="right">
                        <asp:Label ID="lblGrandTotal" runat="server" SkinID="Bold"></asp:Label>
                    </td>
                </tr>
            </table>
            <center>
                <asp:Chart ID="chtLandBett" runat="server">
                    <Series>
                        <asp:Series Name="Default" ChartType="Pie">
                        </asp:Series>
                    </Series>
                    <ChartAreas>
                        <asp:ChartArea Name="ChartArea1">
                            <Area3DStyle Enable3D="True" />
                        </asp:ChartArea>
                    </ChartAreas>
                    <Titles>
                        <asp:Title Name="Title1" Text="Suelo - Mejoras">
                        </asp:Title>
                    </Titles>
                </asp:Chart>
                <asp:Chart ID="chtLandClasification" runat="server">
                    <Series>
                        <asp:Series Name="Default" ChartType="Pie">
                        </asp:Series>
                    </Series>
                    <ChartAreas>
                        <asp:ChartArea Name="ChartArea1">
                            <Area3DStyle Enable3D="True" />
                        </asp:ChartArea>
                    </ChartAreas>
                    <Titles>
                        <asp:Title Name="Title1" Text="Distribución del Suelo">
                        </asp:Title>
                    </Titles>
                </asp:Chart>
            </center>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div align="right">
        <asp:Button ID="btnCalculate" runat="server" OnClick="btnCalculate_Click" Text="Calcular" />
        <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Guardar" />
    </div>
</asp:Content>
